<!--
 * @Description: 列表
 * @Author: admin
 * @Date: 2021-06-10 10:27:27
 * @LastEditors: admin
 * @LastEditTime: 2021-06-10 17:11:28
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>列表</title>
  <script src="./react.development.js"></script>
  <script src="./react-dom.development.js"></script>
  <script src="./babel.min.js"></script>
</head>

<body>
  <div id="root">

  </div>
</body>
<script type="text/babel">
  const numbers = [1,2,3,4,5];
  const listItems = numbers.map(
    (number)=>{
    return <li key={number.toString()}>{number}</li>
  })

  // 渲染组件
  ReactDOM.render(
    <ul>{listItems}</ul>,
    document.getElementById('root')
  )

</script>

</html>